import { request } from "@/utils/request"

/** 列表 */
export function getData(page: number, pageSize: number) {
  return request({
    url: `/v1.0/information/list?page=${page}&pageSize=${pageSize}`,
    method: "get"
  })
}

/** 查询 */
export function searchData(type: string, val: string) {
  return request({
    url: `/v1.0/information/search?${type}=${val}`,
    method: "get"
  })
}

/** 增 */
export function createData(data: any) {
  return request({
    url: "/v1.0/information/add",
    method: "post",
    data
  })
}

/** 删 */
export function delData(id: string) {
  return request({
    url: `/v1.0/information/del?id=${id}`,
    method: "delete"
  })
}

/** 改 */
export function updateData(id: string, data: any) {
  return request({
    url: `/v1.0/information/update/${id}`,
    method: "put",
    data
  })
}
